﻿/**
 * ...
 * @author sminutoli
 */
import com.dmotiko.prune.*
import com.dmotiko.general.*
import mx.transitions.easing.Regular;
import mx.transitions.Tween;
import mx.utils.Delegate;

class Section extends BaseClip
{
	
	private function initClip():Void {
		bShowed = false;
		_alpha = 0;
		_visible = false;
		
	}
	
	public function show():Void {
		this._visible = true;
		registerTween( "fade", new Tween( this,  "_alpha", Regular.easeOut, this._alpha, 100, 0.5, true), false, true );
	}
	
	public function hide():Void {
		registerTween( "fade", new Tween( this,  "_alpha", Regular.easeOut, this._alpha, 0, 0.5, true), false, true );
	}
	
	private function tweenFinished( key:String, tween:Tween):Void {
		if ( key.indexOf("fade") > -1 && this._alpha > 0 ) {
			showEnd();
						
		} else if ( key.indexOf("fade") > -1 && this._alpha == 0 ) {
			_visible = false;
			hideEnd();
		}
	}
	
	
}